import { Dimensions, DeviceInfo, Platform, StatusBar } from 'react-native';

export const HOST = __DEV__
  ? 'http://192.168.0.218:8082'
  : // ? 'http://192.168.0.60:8080'
    //'http://192.168.0.153:8888' // 贠玉晶
    // ? 'http://192.168.0.218:8082' // 李鹏
    // ? 'http://192.168.0.242:8082' // 李杨明
    // '192.168.0.22:9060'  // 党守杰
    'http://119.36.136.218:9002';

export const PHOTO_HOST = __DEV__
  ? 'http://192.168.0.21:8080'
  : 'http://119.36.136.218:9002';

/****************颜色****************/

export const miWhite = '#f9f9f9';
export const white = '#FFF';
export const gray = '#aaa';
export const lightGray = '#F4F4F4';
export const btnLabelColor = '#000';
export const transparentColor = '#00000000';

export const mainBackgroundColor = miWhite;
export const tabBackgroundColor = '#ffffff';
export const cardBackgroundColor = '#FFF';
export const cardShadowColor = '#000000';
export const actionBlue = '#267aff';

export const lineColor = '#F4F4F4';

export const primaryNavColor = '#fff'; // 导行栏背景色
export const primaryColor = '#D83232';
export const primaryDarkColor = '#121917';
export const primaryLightColor = '#42464b';
export const activeColor = '#f00'; // 激活时的颜色
export const blue = '#3399ff';
export const green = '#45C473';
export const lightGreen = '#BEEACE';
export const red = '#FF0B00';
export const lightRed = '#FFAAA6';

export const webDraculaBackgroundColor = '#282a36';

export const selectedColor = primaryDarkColor;
export const selectionColor = 'rgba(0,0,0,0.5)'; // 输入框光标颜色
export const linkTextColor = '#0e6ebb';
export const titleTextColor = miWhite;

export const mainTextColor = '#222';
export const subTextColor = '#666';
export const lightTextColor = '#999';

export const TextColorWhite = '#FFFFFF';
export const TextColorMiWhtte = miWhite;

export const tabSelectedColor = activeColor;
export const tabUnSelectColor = '#a6aaaf';

/****************大小****************/
// navbar 高度

export const isIPhoneX = DeviceInfo.isIPhoneX_deprecated;
export const statusBarHeight =
  Platform.OS === 'ios' ? (isIPhoneX ? 44 : 25) : StatusBar.currentHeight;

export const iosnavHeaderHeight = isIPhoneX ? 95 : 75;
export const andrnavHeaderHeight = 70;

export const cardElevation = 3;
export const cardRadius = 5;

export const navBarRightIcon = 20;

export const largeTextSize = 30;
export const bigTextSize = 23;
export const normalTextSize = 18;
export const middleTextSize = 16;
export const smallTextSize = 14;
export const minTextSize = 12;

// tabBar 高度
export const tabBarHeight = 44;
export const tabIconSize = 25;

export const normalIconSize = 40;
export const bigIconSize = 50;
export const largeIconSize = 80;
export const smallIconSize = 30;
export const minIconSize = 20;
export const littleIconSize = 10;

export const distinguishability = 173 / 112;
export const normalMarginEdge = 12;
export const normalNumberOfLine = 4;

export const screenWidth = Dimensions.get('window').width;
export const screenHeight = Dimensions.get('window').height;
export const contentWidth = screenWidth - normalMarginEdge * 2;

export const headerHeight = 40;

// export const screenHeight = Dimensions.get('window').height;

/****************图标****************/
export const nextIcon = 'chevron-right';
export const tabRecommended = 'activity';
export const tabDynamic = 'aperture';
export const tabMy = 'users';

/****************常量****************/
export const TOKEN_KEY = 'token';
export const USER_NAME_KEY = 'user-name';
export const PW_KEY = 'user-pw';
export const USER_BASIC_CODE = 'user-basic-code';
export const USER_INFO = 'user-info';
export const LANGUAGE_SELECT = 'language-select';
export const LANGUAGE_SELECT_NAME = 'language-select-name';
export const REFRESH_LANGUAGE = 'refreshLanguageApp';

export function GetPercentWidth(percentage) {
  const value = (percentage * screenWidth) / 100;
  return Math.round(value);
}
